{% extends "base.html" %}
{% block title %}编辑书籍{% endblock %}
{% block content %}
<h2>编辑用户</h2>
<form method="POST" action="{{ url_for('user_manage.user_edit', user_id=user.id) }}">
    {{ form.hidden_tag() }}
    <p>
        {{ form.username.label }}<br>
        {{ form.username(size=32) }}<br>
        {% for error in form.username.errors %}
            <span style="color: red;">[{{ error }}]</span>
        {% endfor %}
    </p>
    <p>
        {{ form.password.label }}<br>
        {{ form.password(size=32) }}<br>
        {% for error in form.password.errors %}
            <span style="color: red;">[{{ error }}]</span>
        {% endfor %}
    </p>
    <p>
        {{ form.age.label }}<br>
        {{ form.age(size=32) }}<br>
        {% for error in form.age.errors %}
            <span style="color: red;">[{{ error }}]</span>
        {% endfor %}
    </p>
    <p>
        {{ form.birthday.label }}<br>
        {{ form.birthday(size=32) }}<br>
        {% for error in form.birthday.errors %}
            <span style="color: red;">[{{ error }}]</span>
        {% endfor %}
    </p>
    <p>
        {{ form.is_active.label }}<br>
        {{ form.is_active() }}<br>
        {% for error in form.is_active.errors %}
            <span style="color: red;">[{{ error }}]</span>
        {% endfor %}
    </p>
    <p>{{ form.submit() }}</p>
</form>
<!-- 添加删除表单 -->
<form action="{{ url_for('user_manage.user_delete', user_id=user.id) }}" method="post" style="display:inline;">
    {{ form.hidden_tag() }}
    <button type="submit">删除</button>
</form>

<a href="{{ url_for('user_manage.user_list') }}">返回书籍列表</a>
{% endblock %}
